<!-- S 产品详细大模块 -->
<script type="text/javascript">	
	function pageNext() {
		$('#time').attr('value','${time}');
		$('#price').attr('value','${price}');
		$('#pageNo').attr('value',${page.pageNum+1});
		$('#form1').submit();
	}
	function pagePre() {
		$('#time').attr('value','${time}');
		$('#price').attr('value','${price}');
		$('#pageNo').attr('value',${page.pageNum-1});
		$('#form1').submit();
	}
	function pageSelect() {
		$('#time').attr('value','${time}');
		$('#price').attr('value','${price}');
		$('#form1').submit();
	}
	
	function sort1(){
		var times = document.getElementById('orderByTime');
		var time = times.className;
		if(time.indexOf('cur')>=0) {
			if(time.indexOf('desc')>=0) {
				time = "asc cur";
			} else {
				time = "desc cur";
			}
		}else {
			if(time.indexOf('desc')>=0) {
				time = "desc cur";
			} else {
				time = "asc cur";
			}
		}
		$('#price').attr('value','');
		$('#time').attr('value',time);
		$('#form1').submit();
	}	
	
	function sort2(){
		var prices = document.getElementById('orderByPrice');
		var price = prices.className;
		if(price.indexOf('cur')>=0) {
			if(price.indexOf('desc')>=0) {
				price = "asc cur";
			} else {
				price = "desc cur";
			}
		}else {
			if(price.indexOf('desc')>=0) {
				price = "desc cur";
			} else {
				price = "asc cur";
			}
		}
		$('#time').attr('value','');
		$('#price').attr('value',price);
		$('#form1').submit();
	}	
</script>
<section class="grid4m1s">
	<article class="col-main">
		<#if content?exists>
			<div class="related-search">
			搜索"${content}"结果:
			</div>
		</#if>
		<div class="sorting-bar-s">
			<strong class="t">排序</strong>
			<ul class="sorting-act-s">
				<li class="${time}" id="orderByTime"><a href="javascript:void(0);" onclick="sort1()">上架时间</a></li>
				<li class="${price}" id="orderByPrice"><a href="javascript:void(0);" onclick="sort2()">价格</a></li>
		</div>
		<div class="search-res-list">
			<form id="form1" name="form1" action="${basePath}${path}.htm#A1" method="get">
				<input type="hidden" name="type" id="type" value="${types}" />
				<input type="hidden" name="content" id="content" value="<#if content?exists>${content}<#else>""</#if>" />
				<input type="hidden" name="time" id="time" value="${time}"/>
				<input type="hidden" name="price" id="price" value="${price}"/>
				<#if page?exists>
					<#if page.rows?exists>
						<ul class="clearfix">
							<#list page.rows as details>
								<li>
									<#if types=='0'>
										<a href="${basePath}product/${details.id}.htm" target="_blank" class="img" name="A1" id="A1">
									<#elseif types=='1'>
										<a href="${basePath}search/b/${details.id}.htm" target="_blank" class="img">
									<#else>
										<a href="#" target="_blank" class="img">
									</#if>
									<img src="${img_server_url + "/" + details.imageUrl1}" class="s" /></a>
									<p class="n">
									<#if types=='0'>
										<a href="${basePath}product/${details.id}.htm" target="_blank">
									<#elseif types=='1'>
										<a href="${basePath}search/b/${details.id}.htm" target="_blank">
									<#else>
										<a href="#" target="_blank">
									</#if>
										${details.name}</a></p>
									<p class="price"><em class="s"><span>${details.price?default('0')}</span>积分</em></p>
									
								</li>
							</#list>
						</ul>
					</#if>
				
					<#if page.totalPage != 0>
						<div class="page-nav">
							<#if page.pageNum==1>
								<span class="start">上一页</span>
							<#else>
								<a href="javascript:pagePre();" class="prev">上一页</a>
							</#if>
							
							<span class="page-info">转到
								<select id="pageNo" name="pageNo" onchange="pageSelect()">
									<#if page.totalPage != 0>
										<#list 1..page.totalPage as p>
											<option <#if p==page.pageNum>selected="selected"</#if> value="${p }">${p }</option>
										</#list>
									</#if>
								</select>
								/${page.totalPage }页
							</span>
							
							<#if page.pageNum == page.totalPage>
								<span class="last">下一页</span>
							<#else>
								<a href="javascript:pageNext();" class="next">下一页</a>
							</#if>
						</div>
						<#else>
							<section class="correction">
								<img src="${basePath}img/404_search.jpg" alt="sorry" />
								<strong class="hd-t">很抱歉，没有找到与“<em>${content}</em>”相关的宝贝</strong>
								<div class="correction-list">
									<em>建议你</em>
									<ul>
										<li>1、看看输入的文字是否有误</li>
										<li>2、去掉可能不必要的字词，如“的”、“什么”等</li>
									</ul>
								</div>
							</section>
					</#if>
				</#if>
			</form>
		</div>
	</article>
	
	<aside class="col-sub">
		<!-- 上周热兑换榜 -->
		<div class="ranking">
			<div class="hd"><h3 class="hd-t">上周热兑换榜</h3></div>
			<div class="bd">
				<#if details?exists>
					<ul class="list">
						<#list details as detail>
							<li>
								<span class="num">${detail_index+1}</span>
								<#if detail.type==0 && detail.entityId?exists>
									<a href="${basePath}product/${detail.entityId}.htm" target="_blank" class="img">
								<#elseif detail.type==1 && detail.entityId?exists>
									<a href="${basePath}search/b/${detail.entityId}.htm" target="_blank" class="img">
								<#else>
									<a href="#" target="_blank" class="img">
								</#if>
								<img src="${img_server_url + "/" + detail.imageUrl1}" class="s" /></a>
								<p class="n">
								<#if detail.type==0 && detail.entityId?exists>
									<a href="${basePath}product/${detail.entityId}.htm" target="_blank">
								<#elseif detail.type==1 && detail.entityId?exists>
									<a href="${basePath}search/b/${detail.entityId}.htm" target="_blank">
								<#else>
									<a href="#" target="_blank">
								</#if>
								${detail.entityName}</a></p>
								<p class="price"><em class="s"><span>${detail.price?default('0')}</span>积分</em></p>
							</li>
						</#list>
					</ul>
				</#if>
			</div>
		</div>
		
		<!-- 猜你喜欢的 -->
		<div class="ranking guess-pro">
			<div class="hd"><h3 class="hd-t">猜你喜欢的</h3></div>
			<div class="bd">
				<#if guessproducts?exists>
					<ul class="list">
						<#list guessproducts as guessproduct>
							<#if guessproduct_index==1>
								<li class="cur">
							<#else>
								<li>
							</#if>
							<span class="num">${guessproduct_index+1}</span>
							<a href="${basePath}product/${guessproduct.id}.htm" target="_blank" class="img">
							<img src="${img_server_url + "/" + guessproduct.imageUrl1}" />	
							</a>
							<p class="n">
							<a href="${basePath}product/${guessproduct.id}.htm" target="_blank" >
							${guessproduct.name}</a></p>
							<p class="price"><em class="s">
								<span>${guessproduct.price?default('0')}</span>积分</em>
							</p>
							</li>
						</#list>
					</ul>
				</#if>	
			</div>
		</div>
	</aside>
</section>
<!-- E 产品详细大模块 -->